package com.demo.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author sdyang
 * @create 2019-01-11 8:30
 **/
@Mapper
public interface DCLMapper {

    @Select({"create user 'test_user'@'%' identified by '123456'"})
    void create();

    @Select("grant all on test.* to test_user@'%'")
    void grant();

    @Select("revoke all on test.* from test_user")
    void revoke();

    @Select("show grants for test_user")
    List<String> show();

    @Select("drop user test_user")
    void drop();

}
